//
//  DeferredLightingView.h
//  DeferredLighting
//
//  Created by Holmes Futrell on 2/8/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "platform.h"
#import "ShaderProgram.h"
#import "IndexedModel.h"
#import "GLTexture.h"
#import "GLFont.h"

#import "matrix.h"
#import "matrix_helpers.h"
#import "vector.h"

#include <sys/time.h>

#define NUM_SAMPLES 32

@interface DeferredLightingView : NSOpenGLView {
		
	ShaderProgram *tangentShader;
	ShaderProgram *basicShader;
	ShaderProgram *blitShader;	
	ShaderProgram *gammaCorrectShader;	

	ShaderProgram *visualizeColor;	
	ShaderProgram *lightBufferShader;
	ShaderProgram *simpleGenLightbufferShader;
	ShaderProgram *mixShader;
	ShaderProgram *ssdoShader;
	ShaderProgram *bilateralShader;

	IndexedModel *model11, *model12;
	IndexedModel *model21, *model22;

	GLTexture *texture1, *texture2;
	GLTexture *lightmap;
	
	GLFont *font;
	
	int count;
	int fps;
	
	GLuint viewportWidth, viewportHeight;
	
	GLuint fbo;
	
	float rot;
	
	
	// g-fbuffer
	GLuint depthTextureID;
	GLuint normalTextureID;
	
	GLuint diffuseTextureID, ambientTextureID;
	GLuint colorTextureID, albedoTextureID;
	GLuint filteredAmbientTextureID;
	
	float zNear;
	float zFar;
	
	int finalBlitMode;
	
	float fovyInDegrees;
	float right, left, top, bottom;
	float aspect;
			
	struct timeval lastTime;
	
	int samplePatternSize[2];
	GLuint samplePatternTextureID;
	
	BOOL paused;
	
}


@end
